"use client"
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";

interface Comment {
    id: number;
    text: string;
    author: string;
}

export function CommentList({comments}: { comments: Comment[] }) {
    return (
        <Card className="mb-6">
            <CardHeader>
                <CardTitle>评论列表</CardTitle>
            </CardHeader>
            <CardContent>
                <ul className="space-y-4">
                    {comments.map((comment) => (
                        <li key={comment.id} className="border-b pb-4">
                            <p className="font-medium">{comment.author}</p>
                            <p className="text-gray-600">{comment.text}</p>
                        </li>
                    ))}
                </ul>
            </CardContent>
        </Card>
    )
}